Skip to content

feat(Card): expose selected state via data-selected - #1321

Closed
kanakkholwal wants to merge 1 commit into
ClickHouse:mainfrom
kanakkholwal:feat/card-data-selected
Closed

kanakkholwal wants to merge 1 commit into
ClickHouse:mainfrom
kanakkholwal:feat/card-data-selected

Conversation

@kanakkholwal

@kanakkholwal kanakkholwal commented Nov 19, 2026 •

Copy link
Copy Markdown

Description

  • CardPrimary and CardHorizontal set data-selected="true" when isSelected
  • Tests can now check selection without class names

Links and tickets

Fixes #350

Checklist

  • Breaking changes? (add migration notes in changesets)
  • Visual changes? (specify in changesets)
  • Design review needed?

Note

Low Risk
Additive DOM attribute for testability with no change to card behavior or styling logic beyond existing isSelected handling.

Overview
CardPrimary and CardHorizontal now set data-selected="true" on their root element when isSelected is true, and omit the attribute when not selected—giving tests a stable selector instead of class-name coupling (fixes #350).

Unit tests assert the attribute appears and disappears on rerender, and a minor changeset records the @clickhouse/click-ui update.

Reviewed by Cursor Bugbot for commit eaef1c0. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: eaef1c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@XOP

XOP commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Please check here:
#1292

@XOP XOP closed this Nov 19, 2026
@XOP XOP added the duplicate This issue or pull request already exists label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to tell if card is selected in tests

2 participants